package com.xinzhi.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.xinzhi.service.ForgetService;
import com.xinzhi.service.IRecardService;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 忘记密码的控制层
 */
@RestController
public class ForgetController {
    @Autowired
    private ForgetService forgetService;
    @Autowired
    private IRecardService recardService;

    /**
     * 忘记密码
     * @param username 用户名
     * @param identity_card 身份证号码
     * @return
     */
    @GetMapping("/getByPassord")
    public Result getByPassord( String username, String identity_card){
        return forgetService.getByPassord(username, identity_card);
    }

    /**
     * 根据用户名查询
     * @param username 用户名
     * @return
     */
    @GetMapping("/getal")
    public Result getal(String username){
        return recardService.selectal(username);
    }
}
